package com.dm.cloud.images.mapper;

import com.dm.cloud.tkmybatis.service.BaseMapper;
import com.dm.cloud.images.common.po.ImagesEndpoint;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
   * @author hcx
   * @type ImagesEndpointMapper.java
   * @desc ImagesEndpoint mapper
   */

@Mapper
public interface ImagesEndpointMapper extends BaseMapper<ImagesEndpoint> {

    @Select("select * from T_IMAGES_ENDPOINT where state=1 limit 1")
    ImagesEndpoint findActiveLimit1();

    @Select("select node.* from t_images_endpoint node where node.id in (select node_id from t_images_container where app_code=#{appCode})")
    List<ImagesEndpoint> findByAppCode(@Param("appCode") String appCode);
}
